<div id="all_view"> 
<?php
if(@$idUser){
	$view_friend = '<div id="title" style="background:#f6f7f8 url(images/friend_all.jpg) no-repeat left"><h2>Trả lời kết bạn</h2><div style="clear:both; height:1px"></div></div>
	<div id="friend">';
	while($row_ds_traloi = mysql_fetch_array($ds_traloi)){
		$user_friend = $tc->user_info($row_ds_traloi['user_id']);
		$row_user_friend = mysql_fetch_array($user_friend);
		
		$view_friend .= '<div class="item"><a href="index.html?user='.$row_user_friend['id'].'"><img src="'.url_hinh_user_130x130.$row_user_friend['avatar'].'.jpg" alt=""><h4>'.$row_user_friend['name'].'</h4></a><p>'.$total_user_friend.' bạn bè</p> 
		<p><input type="button" name="btn_xacnhan" value="Xác nhận" class="btn_xacnhan '.$row_user_friend['id'].'" />
		<input type="button" name="btn_huy" value="Hủy" class="btn_huy '.$row_user_friend['id'].'" /></p></div>';
	}
	echo $view_friend.'<div style="clear:both" id="aaaa"></div></div>';
}
?>
</div><script type="text/javascript">
$(document).ready(function(e) {
    $(".btn_xacnhan").click(function(){
		var id = ($(this).attr('class')).split(" ");
		$.post("ajax.php",{friend_xacnhan:"friend_xacnhan",id:id[1]},function(data){
			window.location.reload();
		});
	});
	$(".btn_huy").click(function(){
		var id = ($(this).attr('class')).split(" ");
		$.post("ajax.php",{friend_huy:"friend_huy",id:id[1]},function(data){
			window.location.reload();
		});
	});
});
</script>